package pile.customer.entity;

import com.alibaba.fastjson.annotation.JSONField;


/**
 * @Author 三更  B站： https://space.bilibili.com/663528522
 */
//@JsonInclude(JsonInclude.Include.NON_NULL)
//@ApiModel(value = "返回参数对象", description = "ResponseResult对象")
public class ResponseResult<T> {




    /**
     * 状态码
     */
    //@ApiModelProperty("返回状态码")
    @JSONField(name = "code")
    private Integer code;
    /**
     * 提示信息，如果有错误时，前端可以获取该字段进行提示
     */
    //@ApiModelProperty("提示信息，如果有错误时，前端可以获取该字段进行提示")
    @JSONField(name = "msg")
    private String msg;
    /**
     * 查询到的结果数据，
     */
    //@ApiModelProperty("查询到的结果数据")
    @JSONField(name = "data")
    private T data;
    
    //Admin 有一个无参构造 这边也需要 不然feign调用报错
    public ResponseResult(){

    }

    public ResponseResult(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ResponseResult(T data) {
        this.code = 200;
        this.data = data;
    }

    public ResponseResult(Integer code, T data) {
        this.code = code;
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public ResponseResult(Integer code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
}